From a2e0785c8749c4d3766ecf3b70edfb7c2fe4df20 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Fri, 21 Nov 2025 09:44:33 +0000 Subject: (임수민) 준법 Red Flag 해제, 코멘트 수정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../compliance-comments/[id]/page.tsx | 197 +++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 app/[lng]/evcp/(evcp)/(procurement)/basic-contract/compliance-comments/[id]/page.tsx (limited to 'app/[lng]') diff --git a/app/[lng]/evcp/(evcp)/(procurement)/basic-contract/compliance-comments/[id]/page.tsx b/app/[lng]/evcp/(evcp)/(procurement)/basic-contract/compliance-comments/[id]/page.tsx new file mode 100644 index 00000000..359efbed --- /dev/null +++ b/app/[lng]/evcp/(evcp)/(procurement)/basic-contract/compliance-comments/[id]/page.tsx @@ -0,0 +1,197 @@ +import * as React from "react"; +import { notFound } from "next/navigation"; +import Link from "next/link"; +import { eq } from "drizzle-orm"; + +import db from "@/db/db"; +import { basicContractView } from "@/db/schema"; +import { Shell } from "@/components/shell"; +import { + Breadcrumb, + BreadcrumbList, + BreadcrumbItem, + BreadcrumbLink, + BreadcrumbSeparator, + BreadcrumbPage, +} from "@/components/ui/breadcrumb"; +import { Card, CardHeader, CardTitle, CardDescription, CardContent } from "@/components/ui/card"; +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; +import { AgreementCommentList } from "@/lib/basic-contract/agreement-comments/agreement-comment-list"; +import { formatDateTime } from "@/lib/utils"; +import { checkNegotiationStatus } from "@/lib/basic-contract/agreement-comments/actions"; +import { MessageCircle, Building2, FileText, Calendar, ArrowLeft } from "lucide-react"; + +interface ComplianceCommentsPageProps { + params: Promise<{ id: string }>; +} + +export const revalidate = 0; + +export default async function ComplianceCommentsPage(props: ComplianceCommentsPageProps) { + const params = await props.params; + const contractId = Number(params.id); + + if (Number.isNaN(contractId)) { + notFound(); + } + + const contract = await db + .select() + .from(basicContractView) + .where(eq(basicContractView.id, contractId)) + .limit(1) + .then((rows) => rows[0]); + + if (!contract) { + notFound(); + } + + const negotiationSummary = await checkNegotiationStatus(contractId); + + const negotiationStatusLabel = contract.negotiationCompletedAt + ? "협의 완료" + : negotiationSummary.hasComments + ? `협의 진행중 (${negotiationSummary.commentCount}건)` + : "협의 없음"; + + const negotiationBadgeClass = contract.negotiationCompletedAt + ? "bg-green-50 text-green-700 border-green-200" + : negotiationSummary.hasComments + ? "bg-orange-50 text-orange-700 border-orange-200" + : "bg-gray-50 text-gray-600 border-gray-200"; + + const templateLink = contract.templateId + ? `/evcp/basic-contract/${contract.templateId}` + : "/evcp/basic-contract"; + + return ( + +
+ + + + EVCP + + + + 기본계약서/서약서 관리 + + + + + {contract.vendorName ? `${contract.vendorName} 협의 코멘트` : "협의 코멘트"} + + + + + + +
+ + + +
+
+ + + {contract.templateName || "기본계약서"} + + + 계약서 ID {contract.id} · 템플릿 ID {contract.templateId ?? "-"} + +
+ + + {negotiationStatusLabel} + +
+
+ +
+

+ + 협력업체 정보 +

+
+
+ 업체명 + + {contract.vendorName || "미지정"} + +
+
+ 업체코드 + + {contract.vendorCode || "-"} + +
+
+ 이메일 + {contract.vendorEmail || "-"} +
+
+
+ +
+

+ + 진행 정보 +

+
+
+ 요청일 + + {formatDateTime(contract.createdAt, "KR")} + +
+
+ 서명 상태 + + {contract.vendorSignedAt ? "협력업체 서명완료" : "협력업체 서명대기"} + +
+
+ 협의 완료일 + + {contract.negotiationCompletedAt + ? formatDateTime(contract.negotiationCompletedAt, "KR") + : "-"} + +
+
+
+
+
+ + + +
+
+ 협의 코멘트 + + {contract.vendorName + ? `${contract.vendorName}과(와)의 협의 내용을 기록하고 공유합니다.` + : "협의 코멘트를 작성하고 상대방과 공유합니다."} + +
+
+
+ + + +
+
+ ); +} + -- cgit v1.2.3